package com.xbongbong.schedule.enums;

import lombok.Getter;

import java.util.Arrays;
import java.util.List;

/**
 * 延时任务状态
 *
 * @author haibin.zhang
 * @version v1.0
 * @date 2019/2/26 10:19
 * @since v1.0
 */
@Getter
public enum ScheduleTaskStatusEnum {

    NONQUEUED(1, "未入列"),
    QUEUED(2, "已入列"),
    TRIGGERED_SUCCESS(3, "已触发-成功"),
    CANCEL_NONQUEUED(4, "已取消-未入列"),
    TRIGGERED_FAIL(5, "已触发-失败"),
    CANCEL_QUEUED(6, "已取消-已入列"),
    ;

    private Integer code;
    private String memo;

    ScheduleTaskStatusEnum(Integer code, String memo) {
        this.code = code;
        this.memo = memo;
    }

    public static List<Integer> noNeedConsumeStatus() {
        return Arrays.asList(TRIGGERED_SUCCESS.code, CANCEL_NONQUEUED.code, TRIGGERED_FAIL.code, CANCEL_QUEUED.code);
    }

}
